﻿<?php
if(!defined('IN_PHPSCUP'))exit('hacking'); 
class HtmlModel extends BaseModel
{

    var $table  = 'content';	

    function allhtml($v='',$startid=0,$endid=0,$num=0)
    {
		
		 $v = intval($v);
		 if($endid==0&&$startid!=0)
		 {
		  $endid=$startid+30;
		 }

         if($num==0)
		 {
		 $num=30;
		 }
   	     $conditions = " A.user_id >0  and A.table_id=$v and A.lang_type='".trim($GLOBALS['Lang']->_lang_tp)."' ";
		 if($startid!=0)
		 {
         $conditions .= " and A.id>$startid";
		 }
	     if($endid!=0)
		 {
   	     $conditions .= " and A.id<$endid ";		 
		 }
	  
	     $table = $this->table.' A LEFT JOIN '.$this->_prefix.'content_'.$v.' C ON A.id=C.con_id ';
	  
		 $info = $this->S_Sql_Exe(array('table'=>"{$table}",'fields'=> ' A.id,A.table_id,A.lang_type ','limit' =>"0,{$num}", 'conditions' =>"{$conditions}"));
    
		 return $info;
   
    }


}




?>